home *** CD-ROM | disk | FTP | other *** search
- VARIABLE Instance_Size
-
- : Reset_Instance 0 Instance_Size ! ;
- : Add_Attribute Instance_Size @ DUP 4 + Instance_Size ! ;
- : Get_Instance 8 + @ ;
-
- ( --- Create Class --- )
-
- Reset_Instance
-
- Add_Attribute CONSTANT Num
- Add_Attribute CONSTANT Den
-
- "my_Search" Instance_Size @ BST_MakeClass CONSTANT my_SearchClass
-
- my_SearchClass "Class=" .STR . CR
-
- ( --- Add Method --- )
-
- my_SearchClass
-
- :METHOD Init
- ( Methods are called with three parameters on stack:
- pointer to a taglist, pointer to the object, and the flags. )
-
- CR "METHOD CALL INIT" .STR CR
-
- ( drop the taglist )
- DROP
-
- ( get the pointer to the data section of the object )
- Get_Instance
-
- DUP Num + 0 SWAP ! Den + 0 SWAP !
-
- RETURN ;
-
- #OBM_INIT
-
- CLSS_AddMethod
-
- ( ************************ )
- :METHOD local
- "** local method call" .STR CR
- RETURN ;
-
- #OBM_local1 CLSS_AddMethod
-
- my_SearchClass BST_AddClass DROP
-
-
-
- ( --- Create Object --- )
-
- 0 "my_SearchClass" 0 OBJ_NewObject CONSTANT My_Object
-
- My_Object "Object=" .STR . CR
-
- ( Do something to the Object )
-
- My_Object #OBM_INIT 0 0 OBJ_DoMethod DROP
-
- ( ********************* )
- My_Object #OBM_FOREACH
-
-
- ( Get Rid of the Object )
-
- My_Object OBJ_DisposeObject DROP
-
- ( ------- Clean Up --------- )
-
- my_SearchClass BST_RemoveClass DROP
- my_SearchClass BST_FreeClass DROP
-
- 0 RETURN
-